﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace CaptialVices
{
    class SkillBar : ICustomDrawable, ICustomUpdatable
    {
        private Dictionary<String, Sprite> skillSprites = new Dictionary<string, Sprite>();

        public void SetIcons(Dictionary<String, Texture2D> skillImages, Vector2 start)
        {
            int i = 0;
            foreach (KeyValuePair<string, Texture2D> keyVal in skillImages)
            {
                Sprite sprite = new Sprite();
                sprite.Position = new Vector2(start.X + i * keyVal.Value.Width + 10, start.Y);
                sprite.Texture = keyVal.Value;

                skillSprites.Add(keyVal.Key, sprite);

                i++;
            }
        }

        public void Update(GameTime gameTime)
        {
            throw new NotImplementedException();
        }

        public void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {
            spriteBatch.Begin();

            foreach (KeyValuePair<string, Sprite> keyVal in skillSprites)
            {
                Sprite sprite = keyVal.Value;

                sprite.Draw(spriteBatch, gameTime);
            }

            spriteBatch.End();
        }
    }
}
